﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>普通对话框</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
    <div class="container">
        <button class="btn btn-default" data-toggle="modal" data-target="#dlg" data-backdrop="static">登录</button>
        <button class="btn btn-default" onclick="showDlg();">登录(JS)</button>
    </div>
    <div id="dlg" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">用户登录</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label for="username" class="control-label col-md-2">用户名</label>
                            <div class="col-md-10">
                                <input type="text" id="username" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password" class="control-label col-md-2">密码</label>
                            <div class="col-md-10">
                                <input type="password" id="password" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-offset-2">
                                <button type="button" class="btn btn-default" data-dismiss="modal">登录</button>
                                <button type="button" class="btn btn-default" onclick="closeDlg();">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <div class="text-center">
                        <a href="#">注册</a>
                        <a href="#">忘记密码</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="scripts/jquery-1.11.0.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        function showDlg() {
            $("#dlg").modal({ 'backdrop': 'static' });
        }
        function closeDlg() {
            $("#dlg").modal('hide');
        }
    </script>
</body>
</html>
